package com.zhuss.order.order;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import com.zhuss.bean.bo.order.order.DetailOrderBo;
import com.zhuss.bean.bo.order.order.SearchOrderBo;
import com.zhuss.common.ReadService;
import com.zhuss.order.processor.OrderRead;
import com.zhuss.exception.ShopException;

/**
 * @description: 订单查询Service
 * @author: zhushanshuo
 * @create: Wed Mar 24 22:32:50 CST 2021
 **/
@Component("orderReadService")
public class OrderReadService implements ReadService<Object, Object> {
	
	@Autowired
	@Qualifier("orderRead")
	private OrderRead orderRead;
	
	/**
	 * 详情
	 */
	@Override
	public Object detail(Object param) throws ShopException {
		DetailOrderBo bo = (DetailOrderBo) param;
		Long orderId = bo.getOrderId();
		Object vo = orderRead.detail(orderId);
		return vo;
	}
	
	/**
	 * 列表
	 */
	@Override
	public Object list(Object param) {
		SearchOrderBo bo = (SearchOrderBo) param;
		Object result = orderRead.list(bo);
		return result;
	}
	
}

